<template>
	<view class="container big-box">
		<top-navigation :isBack="true" bgColor="#17171F00" isFix isShow>
			<!-- <view slot='center-slot' class="left-slot">
				{{type == 'user'?'用户协议':type == 'play'?'买家须知':'隐私政策'}}
			</view> -->
		</top-navigation>
		<view class="title">
			{{title}}
		</view>
		<view class="time">
			{{ctime_text}}
		</view>
		<view class="content">
			<u-parse :content="getContent"></u-parse>
		</view>
	</view>
</template>

<script>
	//在需要加、解码的的文件里引入【注意替换成自己的路径】
	import {
		Base64
	} from '@/utils/plugs/imgOrBase64.js';

	// let msg = 'Hello, base64！我是威叔~~_~!';

	// let encodeStr = Base64.encode(msg); //加密
	// console.log(encodeStr);

	// let decodeStr = Base64.decode(encodeStr);//解码
	// console.log(decodeStr);
	import validate from 'common/js/validate.js';
	import auth from 'common/js/auth.js';
	import globalConfig from '@/common/js/golbalConfig.js';
	import {
		randomString
	} from '../../utils/libs.js'
	import base64Arraybuffer from 'base64-arraybuffer'
	export default {
		data() {
			return {
				type: 'user',
				ctime_text:'',
				title:'',
				content: ``
			};
		},
		mixins: [auth, globalConfig],

		onLoad(option) {
			let that = this
			if (option.id) {
				this.type = option.id
				this.getStatic()
			}
			// try {
			// 	const value = uni.getStorageSync('token');
			// 	if (value) {
			// 		that.$navto('/pages/index/index')
			// 	}
			// } catch (e) {
			// 	// error
			// }

			// // this.getCaptcha()

			// if (uni.getStorageSync('authInfo')) {
			// 	this.authInfo = uni.getStorageSync('authInfo');
			// 	this.checkOpenidIsExits();
			// }

		},
		onShow() {

		},
		onReady() {
			// this.getStatic()
		},
		computed: {
			getContent() {
				if (this.content == '') {
					return ''
				}
				// var regex = /\s+src="([^"]*)"\s+style="([^"]*)">/g;
				// var match = regex.exec(this.goodsDetail.content);
				if (true) {
					// var src = match[1]; // 获取style属性的值
					// var style = match[2]; // 获取src属性的值
					// console.log("Style:", style);
					// console.log("Src:", src);
					return this.content
				} else {
					return this.content.replace(/style=/g,
						`style="width:100% !important;display:block;" src="${this.host}/`)
				}
			},
		},
		methods: {
			close() {
				console.log('关闭事件');
				this.userShow = false
			},
			open() {
				console.log('打开事件');
			},
			agree() {
				this.checked = ['true']
				this.close()
			},
			// 方法
			async getStatic() {
				let url = '/api/v1/message'
				let {
					code,
					msg,
					data
				} = await this.$getRequest(url,{
					message_id:this.type
				})
				if (code == 200) {
					console.log(data.content, '静态资源');
					this.content = data.content
					this.title = data.title
					this.ctime_text = data.ctime_text
				} else {
					this.$refs.uToast.show({
						message: msg
					})
				}

			},
		},

	};
</script>

<style>
	/* @import '/common/css/common.css'; */
</style>

<style lang="scss" scoped>
	.bg {
		position: fixed;
		width: 100vw;
		height: 671rpx;
		bottom: constant(safe-area-inset-bottom);
		bottom: env(safe-area-inset-bottom);
	}

	.title {
		font-size: 32rpx;
		color: #FFF;
	}

	.time {
		margin: 38rpx 0 44rpx;
		color: #727886;
		font-size: 23rpx;
	}



	.welecome {
		margin-left: 65rpx;
		font-size: 56rpx;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 66rpx;
	}


	.big-box {
		width: 100vw;
		padding: 0 45rpx;
		background: linear-gradient(180deg, #142336 0%, #17171F 100%);
		min-height: 100vh;
		box-sizing: border-box;

		.left-slot {
			color: #FFF;
		}

		.content {
			color: #98A0AD;
			font-size: 25rpx;
			line-height: 33rpx;
		}
	}


	.input-wrap {

		.content {
			background: #ECF8F8;
			padding: 20rpx 0rpx 20rpx 50rpx;
			margin-top: 80rpx;
			border-radius: 50rpx;

			.input-placeholder {
				font-weight: 400;
				font-size: 30rpx !important;
			}
		}
	}



	/deep/ .reward-popup .uni-popup__wrapper-box {
		background: none !important;
		max-width: unset !important;
		max-height: unset !important;
		overflow: unset !important;
	}

	/deep/ uni-toast .uni-simple-toast__text {
		background: red !important;
	}

	.withdraw-cate {
		width: 100%;
		height: 88rpx;
		display: flex;
		justify-content: center;
		background: #e9f8f8;
		position: fixed;
		top: 0;
		z-index: 999;
		box-sizing: border-box;

		.cate-li {
			background: #e9f8f8;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			height: 88rpx;
			width: 100%;
			font-size: 30rpx;
			line-height: 88rpx;

			.back {
				text-indent: 10rpx;
				font-size: 35rpx;
				font-weight: bold;
				line-height: 88rpx;
			}

			.img {

				left: 10rpx;
				width: 45rpx;
				height: 45rpx;
			}

			&.active:after {
				content: '';
				display: block;
				width: 100%;
				height: 4rpx;
				border-radius: 6rpx;
				position: absolute;
				left: 0;
				bottom: 0;
			}
		}
	}

	.back_pass {
		text-align: right;
		font-size: 15rpx;
		font-weight: 400;
		color: rgba(0, 0, 0, 0.54);
		line-height: 17rpx;
	}

	.location {
		text-align: center;
		width: 80%;
		position: absolute;
		left: 50%;
		transform: translate(-50%);
		bottom: 20rpx;
	}


	/deep/ uni-checkbox .uni-checkbox-input {
		border-radius: 50%;
		width: 25rpx;
		height: 25rpx;
	}

	/deep/ uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		color: #fff !important;
		background: #6BC5C4;
	}

	.text {
		font-size: 12px;
		color: #666;
		margin-top: 5px;
	}

	.uni-px-5 {
		padding-left: 10px;
		padding-right: 10px;
	}

	.uni-pb-5 {
		padding-bottom: 10px;
	}

	::v-deep .x-img {
		margin-right: 21rpx;
	}

	// 横线式输入框
	.find-form {
		width: calc(100% - 84rpx);
		margin: 81rpx auto 0;
		padding: 0rpx 24rpx;
		box-sizing: border-box;
		border-radius: 15rpx;
		position: relative;


		.form-input {
			display: flex;
			align-items: center;
			margin-top: 32rpx;
			padding: 0 16rpx 0 32rpx;
			background: #21202E;
			border-radius: 10rpx;
			height: 100rpx;
			color: #FFF;
			border: 1rpx solid rgba(0, 0, 0, 0.1);

			.location-num {
				font-size: 30rpx;
				margin-right: 10rpx;
			}

			.dynacode {
				// background: linear-gradient(180deg, #FF7D87 0%, #DF0011 100%);
				// border-radius: 60rpx 60rpx 60rpx 60rpx;
				font-size: 24rpx;
				font-weight: 400;
				color: #3ADD8F;
				padding: 16rpx 13rpx;
			}

			.placeholder-img {
				margin-right: 21rpx;
				width: 24rpx;
			}

			.uni-input {
				width: 100%;
				// background: #21202E;
			}

			input {
				padding: 0;

				// font-size: 16px;
				// font-size: 26px;

			}
		}

		.user-agreement {
			position: fixed;
			left: 50%;
			transform: translate(-50%, 0);
			bottom: 8vh;
			font-size: 26rpx;
			color: #93939C;
			flex-wrap: nowrap;

			.user-read {
				margin: 0 10rpx;
				color: #3ADD8F;
			}
		}

		.tips {
			margin-top: 20rpx;
			width: 100%;
			font-size: 24rpx;
			color: #93939C;
		}

		.find-btn {
			margin-top: 70rpx;
			width: 616rpx;
			height: 82rpx;
			background: #21202E;
			border-radius: 10rpx;
			color: #9196AE;
			font-weight: bold;

			&[disabled] {
				background-color: #f7f7f7 !important;
			}
		}

		.find-btn-register {
			margin-top: 70rpx;
			width: 200rpx;
			height: 82rpx;
			background: linear-gradient(180deg, #FF7D87 0%, #DF0011 100%);
			border-radius: 60rpx 60rpx 60rpx 60rpx;
			color: #FFF;

			&[disabled] {
				background-color: #f7f7f7 !important;
			}
		}
	}

	// 车牌输入框
	.plateno-form {
		width: calc(100% - 84rpx);
		margin: 182rpx auto 0;
		padding: 106rpx 50rpx 70rpx;
		box-sizing: border-box;

		background: #FFF;
		box-shadow: 2px 3px 7px 1px rgba(0, 0, 0, 0.1);
		border-radius: 15rpx;
		position: relative;

		.plateno-btn {
			margin: 68rpx auto 0;
			// width: calc(100vw - 210rpx);
			border-radius: 15rpx;
			color: #fff;
			font-size: 23rpx;
			font-weight: 400;
			height: 64rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 15rpx;

			&[disabled] {
				background-color: #f7f7f7 !important;
			}
		}
	}

	.align-type {
		display: flex;
		// align-items: center;
		justify-content: space-between;
	}

	.placeholder-class {
		font-size: 30rpx;
		font-weight: 400;
		color: #A7A7A7;
	}

	.captcha {
		// width: ;
		height: 64rpx;
	}
</style>